
package com.demo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.demo.common.excel.ExcelService;
import com.demo.entity.Student;
import com.demo.entity.StudentQuery;
import com.demo.mapper.StudentMapper;
import com.demo.service.StudentService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * serviceImpl
 */
@Service
@ExcelService(scene = "student",importMethod = "save",exportMethod = "getQueryList",targetClass = Student.class)
public class StudentServiceImpl extends ServiceImpl<StudentMapper,Student> implements StudentService {


    @Override
    public List<Student> getQueryList(StudentQuery studentQuery) {
        return this.list(new QueryWrapper<Student>().eq(studentQuery.getAge()!=null,"age",studentQuery.getAge()));
    }
}
